define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'key.projects/index',
        add_url: 'key.projects/add',
        edit_url: 'key.projects/edit',
        delete_url: 'key.projects/delete',
        export_url: 'key.projects/export',
        modify_url: 'key.projects/modify',
    };

    return {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id',search: false, title: 'id'},
                    {field: 'title', title: '标题'},
                    {field: 'summary',search: false, title: '摘要'},
                    {field: 'type',search: false, title: '类型'},
                    {field: 'village_id', search: 'select', selectList: villageSelects, title: '村单位'},
                    {field: 'images', search:  false,title: '图片 以 | 做分割符号', templet: ea.table.image},
                    {field: 'hits',search: false, title: '阅读量'},
                    {field: 'status', search: 'select', selectList: {0: '隐藏', 1: '正常'}, title: '状态'},
                    {field: 'sort',search:  false, title: '排序', edit: 'text'},
                    {field: 'remark', search:  false,title: '备注说明', templet: ea.table.text},
                    {field: 'create_time', search: false, title: '创建时间'},
                    {width: 250, title: '操作', templet: ea.table.tool},

                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
});